<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>LifeCycle</title>
    </head>
    <body>
        <div id="app">
            <input v-value/>
        </div>
        <script src="my-vue.js"></script>
        <script>  
        Vue.directive('value',{//def
            //当el这个DOM元素被插入到父节点的时候调用
            inserted(el,binding){
                el.value = 'hello';
            }
        });
        var vm = new Vue({
            el:'#app',
            data:{
                name:'zhangsan',
                styleObj:{
                    width:'100px',
                    height:'100px',
                    backgroundColor: 'green'
                }
            },
        });
    </script>
    </body>
</html>